import * as types from '../_types/balance';

interface IState{
    [key: string]: any
}

const initialState = {
    amountToCny: 53211,
}


export default function updateBalance(state:IState = initialState, action) {
    const {type, payload} = action;
    switch (type) {
        case types.UPDATE_BALANCEINFO: {
            return {
                ...state,
                ...payload
            }
        }
        case types.LOGOUT: {
            return {};
        }
        case types.DEL_BALANCEINFO: {
            return {};
        }
        default: {
            return state;
        }
    }
}